/**
 * 
 */
package ru.olympus.antonyhands.ao.client.widgets;

import ru.olympus.antonyhands.ao.client.AOHelperServiceAsync;
import ru.olympus.antonyhands.ao.shared.item.EItemParentType;
import ru.olympus.antonyhands.ao.shared.item.EItemsViewType;

import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * @author AntonyHands
 * @since 16.02.2012
 */
public class ItemByCategoryInfoPanel extends VerticalPanel
{
    private AOHelperServiceAsync _service;
    private ItemCategoriesListBox _itemCategories;
    private ItemsListBox _items;

    public ItemByCategoryInfoPanel(AOHelperServiceAsync service)
    {
        _service = service;
        
        Grid table = new Grid(2, 2);
        add(table);

        table.setHTML(0, 0, "Категория");
        table.setHTML(1, 0, "Предмет");
        
        _itemCategories = new ItemCategoriesListBox(_service);
        table.setWidget(0, 1, _itemCategories);
        
        _items = new ItemsListBox(_service, _itemCategories, EItemParentType.ITEM_CATEGORY, EItemsViewType.ALPHABETICAL);
        table.setWidget(1, 1, _items);
        
        add(new ItemInfoGrid(_service, _items));
    }
}
